package com.ler.dubbo.demo.controller;

import com.ler.dubbo.api.domain.User;
import com.ler.dubbo.demo.result.HttpResult;
import com.ler.dubbo.demo.service.LocalUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lww
 * @date 2019-08-17 16:55
 */
@Api(value = "/", description = "用户相关")
@RequestMapping("/")
@RestController
public class UserController {

	@Resource
	private LocalUserService localUserService;

	@ApiOperation("获取用户")
	@GetMapping("/user")
	public HttpResult getUser() {
		User user = localUserService.getUser();
		return HttpResult.success(user);
	}

}
